package main.chapter7

fun main() {
    val source = "Hello,this is my phone number :010-12345678"
    val pattern = """.*(\d{3}-\d{8}).*"""

    Regex(pattern = pattern)
        .findAll(input = source)
        .toList().flatMap {
            it.groupValues
        }
        .forEach(::println)
}